// activityBottomPopup.js
/*
 *	@param topTitle标题
 *	@param pTag1标签1 不传显示默认
 *	@param pTag2标签2 不传显示默认
 *	@param pTag3标签3 不传显示默认
 *	@param imgUrl图片路径
 *	@param title标签名称
 *  return tag 0点击背景 1点击tag1 2点击tag2 3点击tag3 4点击取消
	使用方法：
	var popup = new activityBottomPopupObjc();
	popup.openBottomPopup({
		topTitle : disData.name,
		pTag1 : {
			imgUrl : '../../image/icon_delete.png',
			title : '删除'
		},
		pTag2 : {
			imgUrl : '../../image/icon_edit.png',
			title : '编辑'
		},
		pTag3 : {
			imgUrl : '../../image/icon_end.png',
			title : '结束'
		}
	}, function(tag){
		alert(tag);
		popup.closeBottomPopup();
	});
*/
//生成底部弹窗类
var activityBottomPopupObjc = function(){
	this.openBottomPopup = function(param, callBack){//打开底部弹窗
		api.openFrame({
		    name: 'activityBottomPopup',
		    url: '../../html/Discuss/activityBottomPopup.html',
		    rect: {
		        x: 0,
		        y: 0,
		        w: 'auto',
		        h: 'auto'
		    },
		    pageParam: param,
		    bounces: false
		});
		api.addEventListener({
		    name: 'activityBottomPopupNotifi'
		}, function(ret, err) {
		    var tag = ret.value.tag;
		    callBack(tag);
		});
	};
	this.closeBottomPopup = function(){//关闭底部弹窗
		api.closeFrame({
		    name: 'activityBottomPopup'
		});
		api.removeEventListener({
		    name: 'activityBottomPopupNotifi'
		});
	};
}